/* 基础样式 - 年轻化清新风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1a1a1a;
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
}

/* 头部样式 - 现代卡片设计 */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px 32px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connection-status {
    padding: 12px 24px;
    border-radius: 25px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(238, 90, 82, 0.3);
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    box-shadow: 0 4px 15px rgba(64, 192, 87, 0.3);
}

/* 导航标签 - 现代化设计 */
.tab-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 8px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.tab-btn span {
    position: relative;
    z-index: 1;
}

.tab-btn:hover::before {
    opacity: 0.1;
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active::before {
    opacity: 1;
}

/* 内容区域 */
.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 面板网格布局 */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.panel-grid.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.panel h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.panel h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.panel.full-width {
    grid-column: 1 / -1;
}

/* 表单样式 - 现代化输入框 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #1f2937;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* IP选择器样式 */
.ip-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-selector select {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
}

.ip-selector span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* 按钮样式 - 现代化设计 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.button-group .btn {
    flex: 1;
    min-width: 100px;
}

/* 状态信息 */
.status-info {
    padding: 16px 24px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    margin-top: 16px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

.status-info p {
    color: #1e40af;
    font-weight: 600;
    margin: 0;
}

/* 数据显示区域 */
.data-display {
    margin-bottom: 20px;
}

.data-display textarea {
    min-height: 200px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    line-height: 1.5;
    color: #1f2937;
}

.data-display textarea:focus {
    background: white;
    border-color: #667eea;
}

/* 工具标签页样式 */
.converter-section {
    margin-bottom: 24px;
}

.stats-section {
    margin-bottom: 24px;
}

.stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    height: 60px;
    overflow: hidden;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-item label {
    font-weight: 600;
    color: #6b7280;
    margin: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-item span {
    font-weight: 700;
    color: #1f2937;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
}

/* 转换器样式 */
.converter-section textarea {
    min-height: 140px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

#convert-output {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #1f2937;
}

/* 统计信息动画 */
.stat-item span {
    transition: all 0.3s ease;
}

.stat-item span.updated {
    color: #10b981;
    transform: scale(1.1);
}

/* 连接管理 */
.connections-list {
    margin-bottom: 20px;
}

#connections-container {
    min-height: 120px;
    padding: 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    color: #6b7280;
}

/* 转发列表样式 */
.transfer-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state p {
    margin-bottom: 8px;
}

.transfer-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.transfer-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.transfer-item.running {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.transfer-item.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fef7f7 100%);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.transfer-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.transfer-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transfer-status.running {
    background: #10b981;
    color: white;
}

.transfer-status.stopped {
    background: #6b7280;
    color: white;
}

.transfer-status.error {
    background: #ef4444;
    color: white;
}

.transfer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}

.transfer-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transfer-info-label {
    font-weight: 600;
}

.transfer-actions {
    display: flex;
    gap: 8px;
}

.transfer-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 12px;
}

/* 记事本样式 */
.notepad-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.file-info {
    margin-left: auto;
    display: flex;
    gap: 16px;
    color: #6b7280;
    font-size: 13px;
}

.notepad-editor {
    margin-bottom: 20px;
}

.notepad-editor textarea {
    min-height: 400px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
}

/* 日志样式 */
.log-container {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    color: #1f2937;
    line-height: 1.6;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.log-entry {
    margin-bottom: 4px;
    padding: 8px 12px;
    border-radius: 4px;
    word-wrap: break-word;
}

.log-entry.success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.log-entry.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
}

.log-entry.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

.log-entry.info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    color: #1e3a8a;
}

.log-timestamp {
    color: #64748b;
    font-size: 11px;
    margin-right: 8px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }
    
    .tab-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .panel-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
    }
    
    .stats-display {
        grid-template-columns: 1fr;
    }
    
    .notepad-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-info {
        margin-left: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    .panel {
        padding: 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: inherit;
}

/* 焦点样式 */
*:focus {
    outline: none;
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 1.5s infinite;
} 

/* 日志面板样式 */
.log-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.log-panel h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-panel h3::after {
    display: none;
}

.log-content {
    margin: 10px;
    background: white;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

/* 优化转发列表布局 */
.transfer-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 8px;
}

.transfer-list::-webkit-scrollbar {
    width: 6px;
}

.transfer-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.transfer-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.transfer-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* 确保按钮组在底部 */
.panel .button-group {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* 优化面板布局，确保内容区域可以滚动 */
.panel {
    display: flex;
    flex-direction: column;
}

.panel h3 {
    flex-shrink: 0;
}

.panel > *:not(h3):not(.button-group) {
    flex: 1;
    overflow: hidden;
}

/* 转发列表容器特殊处理 */
#transfer-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.transfer-list {
    flex: 1;
    overflow-y: auto;
} 